# coding=utf8
import sys, os
import PySide6
from shutil import copyfile
from pathlib import Path

projectName = "QT-demo"
if __name__ == '__main__':
    currentPath = sys.path[0]
    cmd = str(f"pyinstaller --name={projectName}  --windowed   mainwindow.py")
    os.system(cmd)
    distPath = str(f"{currentPath}\\dist\\{projectName}")
    dirname = str(f"{os.path.dirname(PySide6.__file__)}\\plugins\\platforms")
    list = os.listdir(dirname)
    success = True
    for fileName in list:
        s = os.system(str(f"copy /B {dirname}\\{fileName} {distPath}  /y"))
        if not Path(str(f"{distPath}/{fileName}")).is_file():
            success = False
    if success:
        print("编译完成")
    print(tuple(list))
